﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using nwrole.toolbox.sync.ServiceHost;
using nwrole.toolbox.sync;

namespace nwrole.toolbox.sync.SourceConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());

            System.Console.WriteLine("Starting Sync Source Service");
            try
            {
                SyncSourceServiceHost srcHost = new SyncSourceServiceHost();
                srcHost.Start(SyncSettings.SyncSourceConnInfo, SyncSettings.SrcDbConnectionString, SyncSettings.SyncDbConnectionString, SyncSettings.SyncDestinationConnInfo, SyncSettings.SyncLockSpan);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            }

            System.Console.WriteLine("Started (press any key to exit)");
            System.Console.ReadKey();
            System.Console.WriteLine("Done.");
        }
    }
}
